package demo;

import java.util.HashSet;
import java.util.Scanner;

/**
 * @Author liangzai
 * @Description:
 */
public class Training {
    //货物摆放
    public static void main1(String[] args) {
        long num = 2021041820210418l;
        long count = 0;
        HashSet<Long> arr = new HashSet<>();
        for (Long i = 1l; i < Math.sqrt(num); i++) {
            if(num%i==0) {
                arr.add(i);
                arr.add(num/i);
            }
        }
        System.out.println(arr.size());
        for(long x:arr) {
            for(long y:arr) {
                if(x*y>num) {
                    break;
                }
                for(long z:arr) {
//					if(x*y>Math.sqrt(num)&&z>num/(x*y)) {
//						continue;
//					}
                    if(x*y*z==num) {
                        System.out.println(x+" "+y+" "+z+" ");
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
        //System.out.println(10266837);
    }

    //路径
    public static void main2(String[] args) {
        int num = 2021;
        int[] dp = new int[num+1];
        for (int i = 2; i <= 21; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = i-1; j >=1; j--) {
                min = Math.min(min, dp[j]+le(j, i));
            }
            dp[i] = min;
        }
        for (int i = 22; i <= 2021; i++) {
            int min = Integer.MAX_VALUE;
            for (int j = i-1; j >=i-21; j--) {
                min = Math.min(min, dp[j]+le(j, i));
            }
            dp[i] = min;
        }
        System.out.println(dp[2021]);
    }

    private static int gcd(int a,int b) {
        return b !=0 ? gcd(b, a%b): a ;
    }

    public static int le(int a, int b) {
        return a*b/gcd(a,b) ;
    }

    //时间显示
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long time = scanner.nextLong()/1000;
        System.out.println(hour(time)+":"+minute(time)+":"+second(time));
    }

    private static String hour(long time) {
        double x = time/3600;
        x %= 24;
        int val = (int)x;
        if(val>=10) {
            return String.valueOf(val);
        }else {
            return "0"+String.valueOf(val);
        }
    }

    private static String minute(long time) {
        double x = time%3600;
        int val = (int)(x/60);
        if(val>=10) {
            return String.valueOf(val);
        }else {
            return "0"+String.valueOf(val);
        }
    }

    private static String second(long time) {
        double x = time%3600;
        int val = (int)(x%60);
        if(val>=10) {
            return String.valueOf(val);
        }else {
            return "0"+String.valueOf(val);
        }
    }

    //最少砝码
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int sum = 0;
        for(int i = 1; i > 0; i++) {
            sum = sum * 3 + 1;
            if(N <= sum) {
                System.out.println(i);
                break;
            }
        }
    }
}
